<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>POS收单运营管理平台</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link href="<s:url value="/css/a.css"/>" type="text/css"
	rel="stylesheet" />
<link href="<s:url value="/css/index.css"/>" type="text/css"

	rel="stylesheet" />
<link href="<s:url value="/css/common.css"/>" type="text/css"
	rel="stylesheet" />
	
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
<script language="javascript" type="text/javascript"
	src="${rootPath}/js/My97DatePicker/WdatePicker.js"></script>
<script type='text/javascript' src='<s:url value="/dwr/engine.js"/>'></script>
<script type='text/javascript' src='<s:url value="/dwr/interface/AddressQuery.js"/>'></script>
<script type="text/javascript" src="<s:url value="/js/query_Address.js" />"></script>
<style>
　　　
　　　　　a {
	text-decoration: none
}

　　　　　a:hover {
	color: red;
	text-decoration: none
}

a:VISITED {
	color: red;
}
　　


　　　
</style>

<script type="text/javascript">




 $(document).ready(function(){
 
      
    $("#buttonid").click(function(){ 
    		 var  is=   subForm();
    		 if(is){
 	 			$("#buttonid").attr("disabled", true);
    		    $("#queryForm").attr("action","<%=basePath%>/setting/clearsearch.ct");
    			$("#queryForm").submit();
    		 }

     });
     
     $("#szPower").click(function() {
			
					$("#queryForm").attr("action","<%=basePath%>/clearExcel/clearExcel.ct");
					$("#queryForm").submit();

		});
  });
function   str2date(str){   
  var   d=null;   
  var   reg=/^(\d{4})(\d{2})(\d{2})$/  ;
  if(arr=str.match(reg))d=new   Date(Number(arr[1]),Number(arr[2])-1,Number(arr[3])) ; 
  return   d;   
  }  
function  subForm(){
	var endTime = $("#maxDate").val();
		 var beginTime = $("#minDate").val();
		
		if(!endTime || !beginTime){
			alert("起始时间范围必须选择!");
			return false;
		} 
		  var date1=str2date(beginTime);
			var date2=str2date(endTime);
			
			if(date1.getMonth()!=date2.getMonth()){
			    alert("选择的起始时间不在同一个月内！");
				return false;
			}
		return true;
}

</script>



</head>

<body>

<s:form id="queryForm" namespace="/setting" action="clearsearch.ct" method="post" theme="simple">
<table class="tb">
    <tbody>
		<tr class="tb-line">
			<td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
		</tr>
		<tr class="tb-line">
			<td class="tb-td" colspan="4"><div class="tb-h3">清算查询</div></td>
		</tr>
		<tr class="tb-line">
            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">清算起始日期：</div></td>
            <td class="tb-td">
                <label class="tb-input-mini">
                	<s:textfield id="minDate" name="searchCondition.minDate" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});"
						theme="simple" cssClass="queryWidth" /> 
				</label>至：
				<label class="tb-input-mini">
					<s:textfield id="maxDate" name="searchCondition.maxDate" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});"
						theme="simple" cssClass="queryWidth" />
				</label>
				<code class="asterisk">*</code>
			</td>	
            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">交易主账号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield id="pan" name="searchCondition.pan" cssClass="queryWidth" />
				</label>
			</td>
		</tr>
		<tr class="tb-line">
            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">商户号：</div>
                </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                <s:textfield id="mchtCd"
							name="searchCondition.mchtCd" cssClass="queryWidth" />
							</label>
							</td>
            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">商户名称：</div></td>
            <td class="tb-td">
                <label class="tb-input-normal">
                <s:textfield id="mchtName"
							name="searchCondition.mchtName" cssClass="queryWidth" />
							</label>
							</td>
				</tr>
				<tr class="tb-line">	
            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">终端号：</div>
                </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                <s:textfield id="termId"
							name="searchCondition.termId" cssClass="queryWidth" />
							</label>
							</td>
							
				<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">交易类型：</div>
            </td>
            <td class="tb-td">
                <label class="tb-select">
                    <s:select id="searchCondition.etstranCode" name="searchCondition.etstranCode" cssClass="queryWidth" list="#request.tranMap" listKey="key" listValue="value" headerKey="99" headerValue="--请选择--"></s:select>
                </label>
            </td>
					
				</tr>
				<tr class="tb-line">
						<td colspan="4" align="center"><span style="font-color: red"><s:actionerror /></span>
							<span style="font-color: red;"><s:actionmessage /></span > <span style="font-color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
					</tr>
					
					
				<tr class="tb-line">
            <td class="tb-td line-submit" align="right" colspan="4">
                <label class="tb-input-submit">
					<input id="buttonid" value="查   询" type="button"/>
				</label>
                <label class="tb-input-submit">
					<s:reset value="取  消" />
                 </label>
                 <label class="tb-input-submit">
					<s:if
					 test="#request.searchRsList != null && #request.searchRsList.size>0">
					   		<input id="szPower" type="button" 
							value="清算对账Excel" />
					</s:if>
					<s:else>
					 	<input id="szPower" disabled="disabled" value="清算对账Excel" type="button" />
					</s:else>
					</label>
			</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
	<tr class="tb-line">
		<td class="tb-td paging" colspan="12" align="left">&nbsp;&nbsp;&nbsp;&nbsp; 
			<page:pageCount max_pages="11" totalPage="${requestScope.totalPage}" currentPage="${requestScope.currentPage}"
				action="${rootPath}/setting/clearsearch.ct?currentPage=" />
		</td>
	</tr>
	</s:if>
</table>
<div class="big-tb">
    <table class="tb" style="width: 160%;">
		<thead>
            <tr class="tb-line">
                <th class="tb-th" colspan="14">清算信息列表</th>
            </tr>
			<tr class="tb-line bg-gray">
				<th class="tb-th">商户号</th>
				<th class="tb-th">商户名称</th>
				<th class="tb-th">终端号</th>
				<th class="tb-th">系统跟踪号</th>
				<th class="tb-th">卡号</th>
				<th class="tb-th">交易日期</th>
				<th class="tb-th">交易时间</th>
						
				<th class="tb-th">交易金额（元）</th>
				<th class="tb-th">手续费用（元）</th>
				<th class="tb-th">总结算金额（元）</th>
				<th class="tb-th">清算日期</th>
				<th class="tb-th">交易类型</th>
				<th class="tb-th">卡类型</th>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="#request.clearList" status="stat" id="element">
			<tr class="tb-line">
				<td class="tb-td" align="center">
					<s:property value="#element.MchtCd"/>
 				</td> 
				<td class="tb-td" align="center" width="150px">
					<s:property value="#element.MchtName"/>
				</td>
				<td class="tb-td" align="center">
					<s:property value="#element.TermId"/>
				</td> 
				<td class="tb-td" align="center">
					<s:property value="#element.SysSer"/>
				</td>
				<td class="tb-td" align="center">
					<s:property value="#element.Pan"/>
				</td>
				<td class="tb-td" align="center">
					<s:property value="#element.StlmDate"/>
				</td>
				<td class="tb-td" align="center">
					<s:property value="#element.TransDateTime"/>
				</td>	 
				<td class="tb-td" align="center">
					<s:property value="#element.TransAmt"/>
				</td>
				<td class="tb-td" align="center">
					<s:property value="#element.MchtFee"/>
				</td>
				<td class="tb-td" align="center">
					<s:property value="#element.MchtSetAmt"/>
				</td>
				<td class="tb-td" align="center">
					<s:property value="#element.MaSettleDtStr"/>
				</td>
				<td class="tb-td" align="center">
					<s:property value="#element.TxnDesc"/>
				</td> 
				<td class="tb-td" align="center">
					<s:property value="#element.CardKindDis"/>
				</td> 
			</tr>
			</s:iterator> 
		</tbody>
	</table>
</div>
</s:form>
	<s:if test="#request.msg !=null">
		<script language="javascript">
			alert("${request.msg}");
		</script>
	</s:if>
</body>
</html>
